<template>
    <div id='' class='info_show_list'>
        <div class="tab_show">
            <Tab :list="tab" @onClick="changeTab" :hiddenMore="true" />
        </div>
        <div class="list">
            <div v-for="(item,index) in list" :key="index" class="item" @click="downLoad(item)">
                <div class="headline"><img :src="pdf" alt="" srcset="" style="margin-right:10px;">
                    <!-- <Ellipsis :text="item.wdName" :lines="1" tooltip /> -->
                    <p class="headline-content" :title='item.wdName'>{{item.wdName}}</p>
                </div>
            </div>
        </div>
        <div class="page">
            <Page :total="total" show-total show-sizer show-elevator @on-change='pageChange' @on-page-size-change="changePageSize" />
        </div>
    </div>
</template>
<script>
import Tab from '@/pages/fontApp/tab.vue'
import pdf from '@/assets/svg/fontApp/pdf_icon.svg'
import { UpLoad } from '@/mixins/uploadMixins.js'

export default {
    name: '',
    props: [''],
    data() {
        return {
            pdf: pdf,
            list: [],
            total: 0,
            pageConfig: {
                page: 1,
                limit: 10,
            },
            type: 0,
            tab: [
                { title: '系统介绍', default: true },
                { title: '操作手册', default: false },
            ],
            wdType: '系统介绍',
        };
    },
    components: { Tab },
    computed: {},
    beforeMount() { },
    mounted() {
        this['$api'] = this.$Api.get(['systemSetup:systemManger']);
        this.getList();
    },
    mixins: [UpLoad],
    methods: {
        getList() {
            this.$api.DocumentPage({ ...this.pageConfig, ...{ wdType: this.wdType } }, res => {
                if (res.code == 200) {
                    this.list = res.data.records ? res.data.records : [];
                    this.total = Number(res.data.total)
                }
            })
        },
        changeTab(data) {
            this.wdType = data.title;
            this.getList();
        },
        // 页码改变
        pageChange(page) {
            this.pageConfig.page = page;
            this.getList()
        },
        // 每页条数改变
        changePageSize(pageSize) {
            this.pageConfig.limit = pageSize;
            this.getList()
        },

        cancel() {
            this.modalShow = false
        },

        downLoad(data) {
            let file = data.doc;
            if (file) {
                this.downloadUrl(file.minioPath, file);
            } else {
                this.$Message.warning('暂无附件')
            }
        },
        print() {

        },
    },

    watch: {}
}
</script>
<style lang='less' scoped>
.info_show_list {
    .tab_show {
        margin-top: 20px;
    }
    .list {
        padding: 1px 0 40px 0;
        height: 500px;
        overflow: auto;
        .item {
            padding: 20px 0;
            display: flex;
            border-bottom: 1px solid #edeef0;
            cursor: pointer;
            font-size: 16px;
            font-family: PingFang SC-Regular, PingFang SC;
            font-weight: bold;
            color: #515a6e;
            .headline {
                width: 100%;
                font-size: 16px;
                font-family: PingFang SC-Regular, PingFang SC;
                font-weight: bold;
                color: #515a6e;
                display: flex;
                justify-content: flex-start;
                .headline-content {
                    word-break: break-all;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    -o-text-overflow: ellipsis;
                }
            }
        }
        .item:first-child {
            border-top: 1px solid #edeef0;
        }
    }
    .page {
        height: 58px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}
.file {
    cursor: pointer;
    text-align: left;
    img {
        width: 16px;
    }
    span {
        margin-left: 10px;
        font-size: 16px;
        font-family: PingFang SC-Regular, PingFang SC;
        font-weight: 400;
        color: #3399ff;
    }
}
.btn {
    text-align: center;
    .print-btn {
        margin-left: 20px;
    }
}
</style>